.\"
.\" Copyright (C) 1994-2021 Altair Engineering, Inc.
.\" For more information, contact Altair at www.altair.com.
.\"
.\" This file is part of both the OpenPBS software ("OpenPBS")
.\" and the PBS Professional ("PBS Pro") software.
.\"
.\" Open Source License Information:
.\"
.\" OpenPBS is free software. You can redistribute it and/or modify it under
.\" the terms of the GNU Affero General Public License as published by the
.\" Free Software Foundation, either version 3 of the License, or (at your
.\" option) any later version.
.\"
.\" OpenPBS is distributed in the hope that it will be useful, but WITHOUT
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
.\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
.\" License for more details.
.\"
.\" You should have received a copy of the GNU Affero General Public License
.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
.\"
.\" Commercial License Information:
.\"
.\" PBS Pro is commercially licensed software that shares a common core with
.\" the OpenPBS software.  For a copy of the commercial license terms and
.\" conditions, go to: (http://www.pbspro.com/agreement.html) or contact the
.\" Altair Legal Department.
.\"
.\" Altair's dual-license business model allows companies, individuals, and
.\" organizations to create proprietary derivative works of OpenPBS and
.\" distribute them - whether embedded or bundled with other software -
.\" under a commercial license agreement.
.\"
.\" Use of Altair's trademarks, including but not limited to "PBS™",
.\" "OpenPBS®", "PBS Professional®", and "PBS Pro™" and Altair's logos is
.\" subject to Altair's trademark licensing policies.
.\"
.TH pbs_preempt_jobs 3B "11 December 2019" Local "PBS Professional"
.SH NAME
.B pbs_preempt_jobs 
\- preempt a list of jobs
.SH SYNOPSIS
#include <pbs_error.h>
.br
#include <pbs_ifl.h>
.sp
.nf
.B int preempt_job_info *pbs_preempt_jobs(int connect, char **jobID_list)
.fi
.SH DESCRIPTION
Sends the server a list of jobs to be preempted.

Sends a 
.I Preempt Jobs
(93) batch request to the server over the connection specified by 
.I connect.

Returns a list of preempted jobs along with the method used to preempt
each one.

.SH ARGUMENTS
.IP connect 8
Return value of 
.B pbs_connect().  
Specifies connection handle over which to send batch request to server.

.IP jobID_list 8
List of job IDs to be preempted, as a null-terminated array of pointers to strings.  
.br
Format for a job ID:
.br
.I <sequence number>.<server name>
.br
Format for a job array ID:
.br
.I <sequence number>[].<server name>
.br
For example:
.RS 11
.nf
const char *joblist[3];
joblist[0]="123@myserver";
joblist[1]="456@myserver";
joblist[2]=NULL;
.fi
.RE

.SH RETURN VALUE
Returns a list of preempted jobs.  Each job is represented in a
.I preempt_job_info 
structure, which has the following fields:

.IP job_id 8
The job ID, in a char*

.IP preempt_method 8
How the job was preempted, in a char:
.br
S 
.br
   The job was preempted using suspension.
.br
C 
.br
   The job was preempted using checkpointing.
.br
R 
.br
   The job was preempted by being requeued.
.br
D 
.br
   The job was preempted by being deleted.
.br
0 (zero)
.br
   The job could not be preempted.
.SH CLEANUP
You must free the list of preempted jobs by passing it directly to 
.B free().
